from random import randint

rand_num = randint(1, 10)

for i in range(3):
    user_num = int(input('请输入您要猜的数字：'))
    if user_num == rand_num:
        print('恭喜您，猜对了')
        break
    elif user_num > rand_num:
        print('很抱歉，猜大了')
    else:
        print('很抱歉，猜小了')